const Sequelize = require('sequelize');
const seq = require('../utils/db')
const Student = seq.define('student', {
  // 在这里定义模型属性
  id: {
    type: Sequelize.DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  name: {
    type: Sequelize.DataTypes.STRING,
    // allowNull: false
  },
  gender: { //性别
    type: Sequelize.DataTypes.INTEGER,
    defaultValue: 0
  },
  major: { //专业
    type: Sequelize.DataTypes.STRING,
    allowNull: false
  }, 
  age: { //年龄
    type: Sequelize.DataTypes.INTEGER,
    allowNull: false
  }, 
  no: { // 学号
    type: Sequelize.DataTypes.STRING,
    allowNull: false,
  },
  grade: { // 等级
    type: Sequelize.DataTypes.STRING,
    allowNull: false
  },
}, {
  // 这是其他模型参数
});

// (async () => {
//   await seq.sync({ force: true });
// })();

module.exports = Student
